package cn.xej.callback;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * @Author alicat.xu
 * @Date 2021/10/20 3:02 下午
 * 交换机发送消息到队列时的回调
 */
@Component
public class RabbitReturnCallback implements RabbitTemplate.ReturnsCallback {

    @Override
    public void returnedMessage(ReturnedMessage returnedMessage) {
        System.out.println("RabbitReturnCallback..... 消息.. "+returnedMessage);
    }
}
